package cn.qh.com.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.URL;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;

/**
 * @Description: TODO
 * @author: MengJiaLin
 * @date: 2021年11月27日 13:41
 */
@Setter
@Getter
@AllArgsConstructor
@NoArgsConstructor
@Builder
@ApiModel
@SuppressWarnings("serial")
public class UpdateCategoryDTO implements Serializable {
    /**
     * 分类id
     */
    @ApiModelProperty(name = "catId", value =
            "分类id", dataType = "java.lang.Long")
    private Long catId;
    /**
     * 分类名称
     */
    @ApiModelProperty(name = "name", value =
            "分类名称", dataType = "java.lang.String")
    @NotBlank(message = "分类名称不能为空")
    private String name;
    /**
     * 父分类id
     */
    @ApiModelProperty(name = "parentcid", value =
            "父分类id", dataType = "java.lang.Long")
    @Min(value = 0, message = "父分类id不能小于0")
    private Long parentcid;
    /**
     * 排序
     */
    @ApiModelProperty(name = "sort", value =
            "排序", dataType = "java.lang.Integer")
    @Min(value = 0, message = "排序不能小于0")
    private Integer sort;
    /**
     * 图标地址
     */
    @ApiModelProperty(name = "icon", value =
            "图标地址", dataType = "java.lang.String")
    @URL(message = "图标地址必须正确")
    private String icon;
    /**
     * 计量单位
     */
    @ApiModelProperty(name = "productunit", value =
            "计量单位", dataType = "java.lang.String")
    @NotBlank(message = "不能为空")
    @Length(min = 0, max = 10, message = "不能小于0大于10")
    private String productunit;
    /**
     * 层级
     */
    @ApiModelProperty(name = "catlevel", value =
            "层级", dataType = "java.lang.Integer")
    private Integer catlevel;
    /**
     * 商品数量
     */
    @ApiModelProperty(name = "productcount", value =
            "商品数量", dataType = "java.lang.Integer")
    @Min(value = 0, message = "商品数量补能小于0")
    private Integer productcount;
}